package com.api.shopapi.service.impl;


import com.api.shopapi.entity.AskAnswerRecordSite;
import com.api.shopapi.mapper.AskAnswerRecordSiteMapper;
import com.api.shopapi.service.AskAnswerRecordSiteService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("AskAnswerRecordSiteServiceImplOne")
public class AskAnswerRecordSiteServiceImpl implements AskAnswerRecordSiteService {

    @Autowired
    private AskAnswerRecordSiteMapper askAnswerRecordSiteMapper;


    @Override
    public
    int insert( AskAnswerRecordSite askAnswerRecordSite){
        return askAnswerRecordSiteMapper.insert(askAnswerRecordSite);
    }


    @Override
    public
    int delete(String askAnswerRecordSiteCode){
        return askAnswerRecordSiteMapper.delete(askAnswerRecordSiteCode);
    }

    @Override
    public AskAnswerRecordSite getByAskAnswerRecordSiteCode(String askAnswerRecordSiteCode){
        return askAnswerRecordSiteMapper.getByAskAnswerRecordSiteCode(askAnswerRecordSiteCode);
    }

    @Override
    public AskAnswerRecordSite getByAskAnswerRecordCodeSort(String askAnswerRecordCode, int sort){
        return askAnswerRecordSiteMapper.getByAskAnswerRecordCodeSort(askAnswerRecordCode,sort);
    }


    @Override
    public
    List<AskAnswerRecordSite> listByAskAnswerRecordCode(String askAnswerRecordCode){
        return askAnswerRecordSiteMapper.listByAskAnswerRecordCode(askAnswerRecordCode);
    }

    @Override
    public
    PageInfo<AskAnswerRecordSite> pageByAskAnswerRecordCode(int pageIndex, int pageSize, String askAnswerRecordCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<AskAnswerRecordSite> complaintList =askAnswerRecordSiteMapper.listByAskAnswerRecordCode(askAnswerRecordCode);
        return new PageInfo<>(complaintList);
    }


}
